package cn.ekuma.epos.datalogic.local;

import cn.ekuma.epos.datalogic.local.dao.ProductDAO;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class LocalDBHelper extends SQLiteOpenHelper {
	
	private static final int DB_VERSION = 5;
	private static final String DB_NAME = "e_pos_local.db"; 

	ProductDAO productDAO;
	
	public LocalDBHelper(Context context) {
		    super(context, DB_NAME, null, DB_VERSION);
		    productDAO=new ProductDAO(this);
	  }

	@Override
	public void onCreate(SQLiteDatabase db) {
		ProductDAO.onCreate(db);
		
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		productDAO.onUpgrade(db, oldVersion, newVersion);
		
		onCreate(db);
	}
	
	
	
	  
}
